#include<bits/stdc++.h>

using namespace std;

int main(){
    int hours[24];
    for(int i=0;i<24;i++)
        cin>>hours[i];
    int x;
    cin>>x;
    while(x<=23&&x>=0){
        if(hours[x]<=50)
            cout<<hours[x]<<" No\n";
        else
            cout<<hours[x]<<" Yes\n";
        cin>>x;        
    }     
    return 0;
}